package com.lucene.blog.db.mapper;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import com.lucene.blog.bean.Comment;

/**
 * 获取评论信息
 * @author yachao
 *
 */
public interface CommentMapper {
	
	// 获取评论信息
	public List<Comment> getCommentData(Map<String, Object> map) throws SQLException;
	
	// 获取总记录数
	public Long getTotal(Map<String, Object> map) throws SQLException;
	
	// 添加评论
	public Integer addComment(Comment comment) throws SQLException;
	
	// 修改评论信息状态
	public Integer updateCommentState(Comment comment) throws SQLException;
	
	// 删除评论信息
	public Integer deleteCommentById(Integer id) throws SQLException;
	
	// 根据博客id删除评论信息，用于删除某篇博客前，先删掉该博客的评论，因为有外键
	public Integer deleteCommentByBlogId(Integer blogId) throws SQLException;
}
